﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Advantage.Data;
using Advantage.Data.Provider;
using KitBuildingWF.DataAccess;
using KitBuildingWF.ViewModels;

namespace KitBuildingWF
{
    static class Program
    {
        static MainWindow mw = null;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            mw = new MainWindow();

            /*
            string connString = DataAccess.ADSAccess.GetDevCropConnectionString();
            AdsConnection conn = new AdsConnection(connString);
            AdsCommand cmd;
            AdsDataReader adsReader;
            int iField;

            try{
                // make the connection to the server 
                conn.Open();

                // create a command object 
                cmd = conn.CreateCommand();

                // specify a simple SELECT statement 
                cmd.CommandText = "select TOP 10 * from Stock";

                // execute the statement and create a reader 
                adsReader = cmd.ExecuteReader();

                // dump the results of the query to the console 
                while (adsReader.Read())
                {

                    for (iField = 0; iField < adsReader.FieldCount; iField++)
                        Console.Write(adsReader.GetValue(iField) + " ");
                    Console.WriteLine();
                }
                conn.Close();
            }
            catch (AdsException e)
            {
                // print the exception message 
                Console.WriteLine(e.Message);
            }
            */
            
            Application.Run(mw);
        }

        static public MainWindow GetMainWindow()
        {
            if (mw != null)
            {
                return mw;
            }
            else
            {
                return null;
            }
        }


    }
}
